package Threadprojects.pro1_matrix.single;

public class SerialMultiply {
    public static void multiply(double[][] m1, double[][] m2, double[][] rs) {
        int m1Rows = m1.length;
        int m1Cols = m1[0].length;
        int m2Cols = m2[0].length;

        for (int i = 0; i < m1Rows; i++) {
            for (int j = 0; j < m2Cols; j++) {
                double sum = 0;
                for (int k = 0; k < m1Cols; k++) {
                    sum += m1[i][k] * m2[k][j];
                }
                rs[i][j] = sum;
            }
        }

    }
}
